/*** idemo.guide ***/ IDEMO GUIDE =Robert J. Mical= 4 July 1985 CONFIDENTIAL and PROPRIETARY Copyright (C) 1985, COMMODORE-AMIGA, INC. All Rights Reserved This file itemizes all of the functions that are testable from the idemo.c program. This is actually just a stripped-down version of the idemo.c switch/case statements. There are two sections: "From the Serial Port Straight to Intuition's Ears" and "RAWKEY to a Window". The idemo.c program is just a main loop that circles endlessly, creating new windows and screens with joyous abandon, jazzing with the colors and the Preferences, and generally misbehaving. It talks to and listens at the serial port for its instructions. The commands that you can send to this main loop are itemized in the "Straight" section below. When idemo opens a window that is configured to receive RAWKEY events, you can send instructions that are specific to that window by using the commands that are itemized in the "RAWKEY" section below. ============================================================================== === From the Serial Port Straight to Idemo's Ears ============================ ============================================================================== case 'A': i = AutoRequest(RecentWindow, &BodyText1, &GoodText, &BadText, DISKINSERTED, NULL); printf("Result of AutoRequest()=%lx\n", i); case 'b': MoveScreen(workscreen, 0, -2); case 'B': MoveScreen(workscreen, 0, 2); case 'c': /* 'c' for crazy screen, to prove microsoft wrong */ i = 0; while ((c = MayGetChar()) == -1) { workscreen = autoopenscreen(workscreen); i++; printf("\nscreen %ld: press any key to quit:", i); for (longi = 0; longi < HALFMILLION; longi++) ; CloseScreen(workscreen); } case 'd': Debug(); case 'D': printf("&AlertString=%lx\n",&AlertString[0]); DisplayAlert(RECOVERY_ALERT, AlertString, 49); case 'e': printf("Leaving now! Bye.\n"); exit(); case 'q': Debug(); case 'p': /* print the active window */ error = PrinterOpen(AllocSignal(-1)); if (error) { printf("Open Printer error=%ld\n", error); break; } workscreen = IntuitionBase->ActiveScreen; RecentWindow = IntuitionBase->ActiveWindow; vp = &workscreen->ViewPort; longi = (RecentWindow->Width << 16) / RecentWindow->Height; i = (dumpwidth * longi) >> 16; error = PrintRPort(RecentWindow->RPort, vp->ColorMap, vp->Modes, 0, 0, RecentWindow->Width, RecentWindow->Height, dumpwidth, i, 0); if (error) printf("The DUMP error # is %ld\n",error); PrinterClose(); case 'P': /* print the active screen */ error = PrinterOpen(AllocSignal(-1)); if (error) { printf("Open Printer error=%ld\n", error); break; } workscreen = IntuitionBase->ActiveScreen; vp = &workscreen->ViewPort; printf("Short=0, Long=1:"); i = GetNum(); printf("\n"); if (i) error = PrintRPort(&workscreen->RastPort, workscreen->ViewPort.ColorMap, workscreen->ViewPort.Modes, 0, 0, workscreen->Width, workscreen->Height, dumpwidth, dumpheight, 0); else error = PrintRPort(&workscreen->RastPort, workscreen->ViewPort.ColorMap, workscreen->ViewPort.Modes, 0, 0, workscreen->Width, workscreen->Height / 4, dumpwidth, dumpheight / 4, 0); if (error) printf("The DUMP error # is %ld\n",error); PrinterClose(); case 's': workscreen = rjopenscreen(workscreen); case 'S': if (workscreen) { CloseScreen(workscreen); workscreen = NULL; } else printf("No Screen opened yet!\n"); case 't': TestITLength(); case 'T': CurrentTime(&Seconds, &Micros); printf("what are you waiting for? Seconds=%ld Micros=%ld\n", Seconds, Micros); case 'v': printf("CloseWorkBench()=%lx\n", CloseWorkBench()); case 'V': printf("OpenWorkBench()=%lx\n", OpenWorkBench()); case 'w': rjopenwindow(workscreen); case 'W': printf("0=8.5, 1=7.5, 2=6.5, 3=5.5, 4=4.5, other=select: "); i = GetNum(); switch (i) { case 0: dumpwidth = 1024; dumpheight = 640; break; case 1: dumpwidth = 904; dumpheight = 565; break; case 2: dumpwidth = 783; dumpheight = 489; break; case 3: dumpwidth = 663; dumpheight = 414; break; case 4: dumpwidth = 542; dumpheight = 339; break; default: printf("\nwidth:"); dumpwidth = GetNum(); printf("\nheight:"); dumpheight = GetNum(); break; } printf("\n"); case 'x': DisplayBeep(NULL); case 'z': View = (struct View *)ViewAddress(); printf("DxOffset=%ld DyOffset=%ld\n", View->DxOffset, View->DyOffset); ============================================================================== === RAWKEY to a Window ======================================================= ============================================================================== case 'a': RemoveGadget(w, &ToggleGadget); RefreshGadgets(w->FirstGadget, w); if (ToggleGadget.Flags & SELECTED)ToggleGadget.Flags &= ~SELECTED; else ToggleGadget.Flags |= SELECTED; case 'A': AddGadget(w, &ToggleGadget, -1); RefreshGadgets(w->FirstGadget, w); case 'c': printf("What pen number: "); pen = GetNum(); printf("\nWhat value for red: "); red = GetNum(); printf("\nWhat value for green: "); green = GetNum(); printf("\nWhat value for blue: "); blue = GetNum(); SetRGB(&w->WScreen->ViewPort, pen, red, green, blue); case 'i': case 'I': TestITLength(); case 'p': case 'P': GetDefPrefs(&prefs, sizeof(struct Preferences)); printf("&prefs=%lx\n",&prefs); Debug(); case 'R': Request(&TestRequest[2], w); case 's': ShowTitle(w->WScreen, FALSE); case 'S': ShowTitle(w->WScreen, TRUE); case 'T': SetWindowTitles(w, "Here's a new Window Title", "The Big-T Screen Title"); case 't': SetWindowTitles(w, -1, "The little-t Screen Title"); case 'w': WindowToBack(w); case 'W': WindowToFront(w); case 'x': SizeWindow(w, -2, 0); case 'X': SizeWindow(w, 2, 0); case 'y': SizeWindow(w, 0, -1); case 'Y': SizeWindow(w, 0, 1); case '1': WBenchToBack(); case '!': WBenchToFront(); case '-': MoveWindow(w, -2, 0); case '_': MoveWindow(w, 2, 0); case '=': MoveWindow(w, 0, -1); case '+': MoveWindow(w, 0, 1);